/**
 * 退款单信息
 */
import React, { Component } from 'react';
import { Row, Col } from 'antd'
import dialog from './Dialog.js'

@dialog
class Refund extends Component {
    render() {
        const { refund } = this.props;
        let refundExtraHtml = null;
        //余额支付不需要显示网关，银行，账户等信息
        if(refund.get('payTypeId').toUpperCase() !== "OBP"){
            refundExtraHtml = [
                <Row className="pusht">
                    <Col span={4}>
                        <label>退款网关：</label> 
                    </Col>
                    <Col span={16}>
                    {refund.get('refundGateName') || '无'}
                    </Col>
                </Row>,
                    <Row className="pusht">
                    <Col span={4}>退款银行：</Col>
                    <Col span={16}>
                        {refund.get('refundBankName') || '无'}
                    </Col>
                </Row>,
                <Row className="pusht">
                    <Col span={4}>
                        <label>退款账户：</label> 
                    </Col>
                    <Col span={16}>
                    {refund.get('refundAccountName') || '无'}
                    </Col>
                </Row>
            ]
        }
        return (
            <div>
                <Row className="pusht">
                    <Col span={4}>
                        <label>退款单号：</label> 
                    </Col>
                    <Col span={16}>
                        {refund.get('receiptId')}
                    </Col>
                </Row>
                <Row className="pusht">
                    <Col span={4}>退款方式：</Col>
                    <Col span={16}>
                        {refund.get('refundTypeName')}
                    </Col>
                </Row>
                <Row className="pusht">
                    <Col span={4}>
                        <label>退款金额：</label> 
                    </Col>
                    <Col span={16}>
                        {refund.get('refundAmount')}
                    </Col>
                </Row>
                <Row className="pusht">
                    <Col span={4}>退款时间：</Col>
                    <Col span={16}>
                        {refund.get('receiptTime')}
                    </Col>
                </Row>
                {refundExtraHtml}
                <Row className="pusht">
                    <Col span={4}>退款备注：</Col>
                    <Col span={16}>
                        {refund.get('refundInfo')}
                    </Col>
                </Row>
            </div>
        );
    }
}

export default Refund;